package com.ycg.blog.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycg.blog.pojo.ArticleConfig;
import com.ycg.blog.service.ArticleConfigService;
import com.ycg.blog.mapper.ArticleConfigMapper;
import org.springframework.stereotype.Service;

/**
* @author lenovo
* @description 针对表【blog_article_config(文章配置信息)】的数据库操作Service实现
* @createDate 2024-03-02 12:05:04
*/
@Service
public class ArticleConfigServiceImpl extends ServiceImpl<ArticleConfigMapper, ArticleConfig>
    implements ArticleConfigService{

    /**
     * 增加浏览量
     * @param articleId
     */
    @Override
    public void addView(Integer articleId) {
        getBaseMapper().addView(articleId);
    }

    /**
     * 根据articleID 新增或更新categoryId
     *
     * @param articleId
     * @param categoryId
     */
    @Override
    public void saveOrUpdateByArticleId(Integer articleId, Integer categoryId) {
        getBaseMapper().saveOrUpdateByArticleId(articleId,categoryId);
    }
}




